package labox.innovation.loginserver.socket.serverpackets;

/**
 * 客户注册返回包
 * 
 * @author Frank
 * 
 */
public final class RegisterOk extends LoginServerPacket {

	public static enum RegistFailReason {
		REASON_ACCOUNT_REGISTED(0x00), 
		REASON_OK(0x01), 
		REASON_USER_OR_PASS_WRONG(0x02), 
		REASON_SYSTEM_ERROR(0x03), 
		REASON_SERVER_OVERLOADED(0x04), 
		REASON_VERSION_ERROR(0x05);

		private final RegisterOk _code;

		RegistFailReason(int code) {
			_code = new RegisterOk(code);
		}

		public final RegisterOk getRegisterOk() {
			return _code;
		}
	}

	private int regCode;

	private RegisterOk(int code) {
		regCode = code;
	}

	@Override
	protected void write() {
		writeByte(PTL_REGISTEROK);
		writeByte(regCode);
	}
}
